<?php
/*
	隐私设置
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
cfc('core')->checklogin();
if($_RQ['op']=='main'){
	$item=$this->get('member_secret',array('mid'=>$_SESSION['uid']));
	if(!$item){
		$item=array();
	}
	$return['item']=$item;
	exi($return);
}
if($_RQ['op']=='post'){
	$post=get_postdata();
	//exi(var_export($post,true),'error');
	$fields=array('mobile','mobile_fee','email','email_fee','address','address_fee','wechat_name','wechat_fee','qq_name','qq_fee');
	foreach($fields as $key){
		if(isset($post[$key])){
			$this->update('member_secret',array($key=>intval($post[$key])),array('mid'=>$_SESSION['uid']));
			break;
		}
	}
	exi('设置成功！');
}